import os
import sys

# 请在此输入您的代码

path = []
result = []
def backtracking():
  if len(path) == 8:
    result.append(''.join(path))
  # 左还是右
  if path.count('(') < 4:
    path.append('(')
    backtracking()
    path.pop()
  if path.count(')') < 4 and path.count('(') > path.count(')'):
    path.append(')')
    backtracking()
    path.pop()

backtracking()
print(len(result))
